build: target host arch for local builds/envtest#2076
Merged
Conversation
Local container image builds and envtest binaries were pinned to amd64, forcing emulation (Rosetta) on Apple Silicon and other arm64 hosts. This produced amd64 controller images and amd64 envtest binaries locally, which can surface subtle runtime bugs. envtest now publishes arm64 binaries (including darwin/arm64), so the historical amd64 pin and the Darwin-specific override are no longer needed. Derive the architecture from the host Go toolchain (go env GOARCH): - ENVTEST_ARCH now follows the host architecture. - BUILD_PLATFORMS defaults to linux/<host arch> so 'make docker-build' produces a native image. Multi-arch release images are built by the fluxcd/gha-workflows release workflow, not by 'make docker-build', so release artifacts are unaffected. Both values remain overridable for cross-arch builds. Signed-off-by: leigh capili <leigh@null.net>
975846d to
b9e3412
Compare
stefanprodan
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On arm64 hosts, builds would use amd64 for both:
ENVTEST_ARCHtest binariesBUILD_PLATFORMSformake docker-buildSo local builds and tests run under emulation (Rosetta) on arm64 hosts, which is slow and occasionally hides subtle runtime bugs like the ones i ran into testing helm-controller. envtest publishes native arm64 binaries now (including darwin/arm64), so the pin and Darwin override is no longer needed.
now:
ENVTEST_ARCHfollows the host archBUILD_PLATFORMSdefaults tolinux/<host arch>somake docker-buildmakes a native imageoverrides still work:
make docker-build BUILD_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7Multi-arch release images come from the fluxcd/gha-workflows release flow, not
make docker-build, so release artifacts are untouched.I ran all tests and docker-builds across the 9 repos via apple silicon
tracking: fluxcd/flux2#5931